from django.shortcuts import render
from .models import PdfInfo


# Create your views here.
def listAll():
    pdfList = PdfInfo.objects.all()
    return pdfList


def indexView(requests):
    if requests.method == "GET":
        pdfInfoList = listAll()
        return render(requests, 'index.html', {'pdfInfoList': pdfInfoList})
    elif requests.method == "POST":
        print(requests.POST)
        return render(requests, 'single.html')


def singleView(requests):
    return render(requests, 'single.html')


def aboutView(requests):
    return render(requests, 'about.html')


def contactView(request):
    return render(request, 'contact.html')


def loginView(requests):
    return render(requests, 'login.html')
